The following routines are used to set the default text and graphic attributes of a document. These attributes determine the color, font, etc. of subsequently added document elements:
setTextFont Sets the default text font for non-styled text data
setTextSize Sets the default text size for non-styled text data
setTextStyle Sets the default text style for non-styled text data
setTextFont
Syntax: setTextFont document, fontName
Returns: TRUE if the requested font was available
FALSE if the requested font could not be found
This command sets the text font that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. If the requested font is not available, the default font (Geneva on the Macintosh, Arial on Windows) is used.
Note that the current font set using setTextFont will be overridden by the fonts, sizes and styles within styled text field cast members that you subsequently append to your document. The default font used for non-styled text data after appending a styled text field will be the last font contained within the text field.
setTextSize
Syntax: setTextSize document, fontSize
This command sets the text size that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object.
setTextStyle
Syntax: setTextStyle document, styleString
This command sets the text style that will be applied to non-styled text data (such as strings) that are subsequently appended to the document object. The values for textStyle correspond exactly to the Director "textStyle" property. Possible values for text styles are:
normal
plain
bold
italic
underline
On the Macintosh, the following additional styles are available:
outline
condense
extend
shadow
All values except normal or plain are added together in a call to setTextStyle, so you can combine a number of styles together in a single call.
Example:
The following example creates a PrintOMatic document, sets the default font to bold italicized 10 point Helvetica, and prints a short text string: